#include "que.h"
#include "stdio.h"

void wait(char key) {
	char val = 0;
	while (key != val) {
		scanf("%c", &val);
	}
}

void print(Que* que) {
	uint8_t i = 0;
	for (i = 0; i < que->ptr; i++) {
		printf("%d ", que->buf[i]);
	}
	printf("\n");
}

void main() {
	int i = 0;
	const uint8_t size = 10;
	Que* que = 0;
	que = Que_Create(size);
	if (que == NULL) {
		printf("que created failed!size=%d\n", size);
		wait(' ');
		return;
	}
	printf("que created success!size=%d\n", size);
	while (1) {
		scanf("%d", &i);
		if (i < 0) {
			break;
		}
		Que_MoveOn(que, i);
		print(que);
	}
	Que_Destroy(que);
}